﻿using Ef.Repository.Entity;
using EF.Framework.Context;
using EF.Framework.Entity;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ef.Repository
{
    public  class MyContext : DbContext //, IDbContext
    {

        public MyContext()
       : base("name=MyuContext")
        {
        }
        public virtual DbSet<Caipin> Caipin { get; set; }
        public virtual DbSet<Test> Test { get; set; }

        public virtual DbSet<User> User { get; set; }
        
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Caipin>()
                .Property(e => e.code)
                .IsUnicode(false);

            modelBuilder.Entity<User>()
               .Property(e => e.Code)
               .IsUnicode(false);
        }

    }
}
